package com.fau.template.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.NotBlank;

/**
 * @desc 数据字典
 * @author dangjh
 * @datetime 2015年6月24日,下午6:12:12
 */
@Entity
@Table(name = "t_key_value")
public class TKeyValue implements Serializable {

	private static final long serialVersionUID = 7657185884359295916L;

	private String id;
	private String keyName;
	private String keyValue;		
	private String typeName;		
	private String pid = "0";				
	private String orderNum;
	
	public TKeyValue() {
	}

	@Id
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@GeneratedValue(generator = "generator")
	@Column(name = "id", length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@NotBlank(message="字典key不能为空")
	@Column(name = "key_name", length = 20)
	public String getKeyName() {
		return keyName;
	}

	public void setKeyName(String keyName) {
		this.keyName = keyName;
	}

	@NotBlank(message="字典value不能为空")
	@Column(name = "key_value", length = 50)
	public String getKeyValue() {
		return keyValue;
	}

	public void setKeyValue(String keyValue) {
		this.keyValue = keyValue;
	}

	@NotBlank(message="字典表的类型不能为空")
	@Column(name = "type_name", length = 30)
	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	@NotBlank(message="父id不能为空")
	@Column(name = "pid", length = 32)
	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	@NotNull(message="排序的值不能为空")
	@Column(name = "order_num", length = 5)
	public String getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}
	
}
